package com.woniuxy.hackredis;

import java.io.IOException;
import java.io.InputStream;
import java.net.ServerSocket;
import java.net.Socket;
import java.nio.charset.StandardCharsets;

/**
 * @Author: 马宇航
 * @Todo: 模拟redis服务器！写一个假的服务，来截获真正的redis服务！
 * @DateTime: 22/09/13/0013 17:33
 * @Component: 成都蜗牛学苑
 **/
public class MyHackRedis {
    public static void main(String[] args) throws IOException {
        ServerSocket serverSocket = new ServerSocket(6379);
        Socket socket = serverSocket.accept();
        InputStream inputStream = socket.getInputStream();
        byte[] read = new byte[2048];
        inputStream.read(read);
        System.err.println(new String(read, StandardCharsets.UTF_8));

//        socket.close();
//        serverSocket.close();
    }
}
